package com.zhizuobiao.service;

import com.zhizuobiao.dao.NewsMapper;
import com.zhizuobiao.entity.News;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;


@Service
public class NewsService implements NewsMapper {


    @Autowired private NewsMapper newsMapper;


    public List<News> findByCategory(News news) throws Exception {
        return newsMapper.findByCategory(news);
    }



    public void saveOne(News news) throws Exception {
            newsMapper.saveOne(news);
    }

    public void updateOne(News news) throws Exception {
            newsMapper.updateOne(news);
    }

    public News findOne(Integer newsId) throws Exception {
        return newsMapper.findOne(newsId);
    }

    public List<News> findAll() throws Exception {
        return newsMapper.findAll();
    }

    public void deleteOne(Integer newsId) throws Exception {
        newsMapper.deleteOne(newsId);
    }
}
